<template>
  <view class="my-settle-container">
    <label class="radio" @click="changeAllState">
      <radio :checked="isFullCheck" color="#c00000" /><text>全选</text>
    </label>
    
    <view class="anmount-box">
      合计:<text class="amount">￥{{checkGoodsAmount}}</text>
    </view>
    
    <view class="btn-settle">
      结算({{checkedCount}})
    </view>
  </view>
</template>

<script>
import { mapMutations } from 'vuex';
import { mapGetters } from 'vuex';
  export default {
    name:"my-settle",
    data() {
      return {
        
      };
    },
    methods:{
      ...mapMutations('m_cart',['updateAllGoodsState']),
      changeAllState(){
        this.updateAllGoodsState(!this.isFullCheck)
      }
    },
    computed:{
      ...mapGetters('m_cart',['checkedCount','total','checkGoodsAmount']),
      isFullCheck(){
        return this.total===this.checkedCount
      }
    }
  }
</script>

<style lang="scss">
.my-settle-container{
  display: flex;
  height: 50px;
  font-size: 14px;
  background-color: white;
  align-items: center;
  justify-content: space-between;
  position: fixed;bottom: 0;
  width: 100%;
  
  .radio{
    display: flex;
    align-items: center;
  }
  .anmount-box{
    color: #c00000;
    font-weight: bold;
  }
  .btn-settle{
    height: 50px;
    background-color: red;
    line-height: 50px;
    padding: 0 10px;
    color: white;
    min-width: 100px;
    text-align: center;
  }
}
</style>